#include<iostream>
using namespace std;
int ZdGyS(int m,int n){
	if(m<n){
		int j=n;
		n=m;
		m=j;
	}
	while(1){ 
		int r=m%n;
		if(r!=0){
			m=n;
			n=r;
		}
		else{
			break;
		}
	}
	return n;
} 
int ZXGBS(int m,int n){
	int x=m;
	int y=n;
	n=ZdGyS(m,n);
	return x*y/n;
} 
int main(){
	struct fs{
		int fz=0;
		int fm=0;
	};
	fs a;
	fs b;
	char o;
	cin>>a.fz>>o>>a.fm;
	cin>>b.fz>>o>>b.fm;
	int k=ZXGBS(a.fm,b.fm);
	a.fz*=k/a.fm;
	b.fz*=k/b.fm;
	a.fm=k;
	b.fm=k;
	fs j;
	j.fz=a.fz+b.fz;
	j.fm=k;
	int q=ZdGyS(j.fz,j.fm) ;
	j.fz/=q;j.fm/=q;
	cout<<j.fz<<"/"<<j.fm;
}
